Skip to content

chore: Define precedence for deprecated 'auth_tokens' vs. 'auth_headers' #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025

Conversation

anubhav756
Copy link
Contributor

This PR addresses the scenario where a user provides both auth_tokens and auth_headers, both of which are deprecated arguments.

Problem

Previously, if a user provided both auth_tokens and auth_headers, the authentication tokens from auth_headers were prioritized. This created an inconsistent behavior, especially considering that auth_tokens was deprecated more recently than auth_headers.

Solution

This change shifts the precedence to auth_tokens. Now, if both auth_tokens and auth_headers are present, only the authentication tokens specified in auth_tokens will be considered.

Reasoning

  1. auth_tokens was deprecated more recently than auth_headers. Prioritizing the more recently deprecated argument provides a clearer signal to users about the intended deprecation path and guides them towards the recommended, non-deprecated args.
  2. We opted not to merge authentication tokens from both deprecated arguments. Merging could lead to increased user confusion and inadvertently encourage continued reliance on these legacy features, hindering migration efforts.
  3. This approach aligns with our broader deprecation strategy. For instance, when a user provides auth_token_getters (the current recommended approach) alongside a deprecated argument like auth_tokens, auth_token_getters takes precedence and overrides the deprecated argument. This PR extends that "latest argument wins" principle to the deprecated arguments themselves, ensuring consistent behavior.

@anubhav756 anubhav756 self-assigned this May 10, 2025
@anubhav756 anubhav756 requested a review from a team as a code owner May 10, 2025 05:22
@anubhav756 anubhav756 force-pushed the anubhav-default-toolset branch from 3a066a9 to da9431c Compare May 12, 2025 14:14
@anubhav756 anubhav756 force-pushed the anubhav-reverse-deprecation branch from 204a6f5 to 64f214c Compare May 12, 2025 14:14
@anubhav756 anubhav756 force-pushed the anubhav-default-toolset branch from da9431c to 03ad571 Compare May 14, 2025 12:12
@anubhav756 anubhav756 force-pushed the anubhav-reverse-deprecation branch 2 times, most recently from 047b827 to e7178f9 Compare May 14, 2025 12:42
@anubhav756 anubhav756 force-pushed the anubhav-default-toolset branch 2 times, most recently from 9dd24ce to d1c6879 Compare May 16, 2025 15:47
@anubhav756 anubhav756 force-pushed the anubhav-reverse-deprecation branch from e7178f9 to 75e7fd2 Compare May 16, 2025 15:48
@anubhav756 anubhav756 force-pushed the anubhav-default-toolset branch from d1c6879 to 8271660 Compare May 16, 2025 16:49
@anubhav756 anubhav756 force-pushed the anubhav-reverse-deprecation branch from 75e7fd2 to aa3b15c Compare May 16, 2025 16:50
@anubhav756 anubhav756 force-pushed the anubhav-default-toolset branch from 8271660 to 506c369 Compare May 16, 2025 20:29
@anubhav756 anubhav756 force-pushed the anubhav-reverse-deprecation branch from aa3b15c to fc79de2 Compare May 16, 2025 20:35
Base automatically changed from anubhav-default-toolset to main May 16, 2025 20:38
This PR addresses the scenario where a user provides both `auth_tokens` and `auth_headers`, both of which are deprecated arguments.

### Problem
Previously, if a user provided both `auth_tokens` and `auth_headers`, the authentication tokens from `auth_headers` were prioritized. This created an inconsistent behavior, especially considering that `auth_tokens` was deprecated more recently than `auth_headers`.

### Solution
This change shifts the precedence to `auth_tokens`. Now, if both `auth_tokens` and `auth_headers` are present, only the authentication tokens specified in `auth_tokens` will be considered.

### Reasoning
1.  `auth_tokens` was deprecated more recently than `auth_headers`. Prioritizing the more recently deprecated argument provides a clearer signal to users about the intended deprecation path and guides them towards the recommended, non-deprecated args.
2.  We opted *not* to merge authentication tokens from both deprecated arguments. Merging could lead to increased user confusion and inadvertently encourage continued reliance on these legacy features, hindering migration efforts.
3.  This approach aligns with our broader deprecation strategy. For instance, when a user provides `auth_token_getters` (the current recommended approach) alongside a deprecated argument like `auth_tokens`, `auth_token_getters` takes precedence and overrides the deprecated argument. This PR extends that "latest argument wins" principle to the deprecated arguments themselves, ensuring consistent behavior.
@anubhav756 anubhav756 force-pushed the anubhav-reverse-deprecation branch from fc79de2 to 881111e Compare May 16, 2025 20:38
@anubhav756 anubhav756 merged commit e9c428b into main May 16, 2025
19 checks passed
@anubhav756 anubhav756 deleted the anubhav-reverse-deprecation branch May 16, 2025 20:43
@release-please release-please bot mentioned this pull request May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants